package org.zjx.task.core;

import org.zjx.task.exception.ChainExecutionException;

import java.util.List;
import java.util.Map;

public interface ITaskChain {
    String getChainId();
    List<ITask> getTasks();
    int currentTaskIndex();
    void setCurrentTaskIndex(int index);
    Map<String,Object> getParams();
    void setParams(Map<String,Object> params);
    void execute(TaskScheduler scheduler) throws ChainExecutionException;
    void pause();
    void resume();
    boolean isPaused();
    int getRestartCount();
    int getMaxRestart();
    void addTask(ITask task);
    void addTask(List<ITask> task);
}
